#include "Stdafx.h"
#include "Randomizer.h"

namespace Pulpy
{

	Randomizer::Randomizer() { std::srand(time(NULL)); }

	Randomizer Randomizer::getInstance()
	{
		static Randomizer s_instance;
		return s_instance;
	}
	int Randomizer::randMax(int max, int min)
	{
		if(max == 0)
			return 0;
		else
			return rand() % max + min;
	}
	float Randomizer::randMax(float max, float min)
	{
		if(max == 0.0f)
			return 0.0f;
		else
			return min + (float)rand()/((float)RAND_MAX/(max-min));
	}
}